<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>命令式与声明式</title>
    <style>
        *{
            text-align: center;
        }
        #switcher{
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border:transparent;
        }
        #switcher.on {
            background-color: green;
        }
        #switcher.on::after{
            content: 'on';
        }
        #switcher.off {
            background-color: red;
        }
        #switcher.off::after{
            content: 'off';
        }
        #switcher.warn{
            background-color: yellow;
        }
        #switcher.warn::after{
            content: 'warn';
        }
    </style>
</head>
<body>
<button id="switcher" class="on"></button>
<!--<script src="imperative.js"></script>-->
<script src="declarative.js"></script>
</body>
</html>